<template>
	<view class="orderonline">
		<view class="advertisement" style="width: 100%;">
			<!--url:http://shop.bcjkcloud.com/h5/#/?accessToken=a17e4387-0e13-4260-8003-7350150beea6&memberId=13457992012 -->
			<web-view :src='url'></web-view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: '',
				idToken: '',
				scurl: '',
				phone: ''
			};
		},
		onLoad(e) {
		},
		onShow() {
			this.getUser()
		},
		mounted() {},
		methods: {
			// async getUser() {
			// 	    this.scurl=uni.getStorageSync('scurl')
			// this.idToken=uni.getStorageSync("x-auth-token")
			// 		this.id = uni.getStorageSync('id');//4028808d7e06939b017e08f352b2001e
			// 		// 在正式环境
			// 		console.log('orderOnline的那边的x-auth-token: '+uni.getStorageSync('x-auth-token'));
			// 		this.url = this.scurl+'#/?accessToken='+this.idToken+'&memberId='+this.id;
			// 		console.log('拼接好的地址: '+this.url);
			// 		// console.log(this.url)
			// 		// this.url = ''http://120.79.0.124/h5/#/''
			// 		// this.url = 'http://119.91.155.46/sc/#/?accessToken='+this.idToken;
			// 		// this.url = 'http://localhost:8081/#/?accessToken='+this.idToken;
			// },
			//方法二：
			// async getUser() {
			// 	let that = this;
			// 	this.idToken = uni.getStorageSync("x-auth-token")
			// 	this.phone = uni.getStorageSync('HC_name')
			// 	console.log('方法二的this.idToken: '+this.idToken);
			// 	const res = await ({
			// 		url: 'http://shop.bcjkcloud.com/h5/#/?accessToken=' + this.idToken+'&memberId='+this.phone,
			// 	})
			// 	this.url = res.url
			// 	console.log('这个是输出的url: ' + JSON.stringify(res))
			// },
			//方法三：
			// async getUser() {

			// 	this.scurl = uni.getStorageSync('scurl')
			// 	this.idToken = uni.getStorageSync('x-auth-token')
			// 	this.phone  =uni.getStorageSync('HC_name')
			// 	console.log('this.scurl:'+this.scurl+'   this.phone: '+this.phone+"  this.idToken: "+this.idToken);
			// 	this.url = this.scurl + '#/?accessToken=' + this.idToken + '&memberId=' + this.phone;
			// 	// this.url='http://shop.bcjkcloud.com/h5/#/?accessToken=fb9e60c4-1893-47a0-ba7b-c466d2a99e6b&memberId=13457992012'; //浏览器的地址复制到这手机正常打开
			// 	// // this.url='http://shop.bcjkcloud.com/h5/#/?accessToken=c6ea0141-ebb6-472f-a8d4-3940db3be668&memberId=13457992012';//手机上打开的
			// 	console.log('最后拼接的url: '+this.url);
			// },
			//方法四：
			// getUser() {
			// 	uni.removeStorageSync('storage_key');
			// 	request(uni.getStorageSync('scurl'),{
			// 		Authorization:uni.getStorageSync('x-auth-token'),
			// 		memberId:uni.getStorageSync('HC_name'),
			// 	},'GET').then(res=>{
			// 		// const useritem = res.data
			// 		this.url = res.data
			// 		// uni.setStorageSync('x-auth-token',res.data)
			// 		// console.log(uni.getStorageSync('x-auth-token'));
			// 		console.log('调用接口的返回结果: '+res);
			// 	}).catch(res=>{
			// 		console.log(res);
			// 	})
			// }
			//方法五：
			async getUser() {
				this.scurl = uni.getStorageSync('scurl')
				this.idToken = uni.getStorageSync('idToken')
				this.phone = uni.getStorageSync('phone')
				// console.log(this.scurl)
				this.url = this.scurl + '#/?accessToken=' + this.idToken + '&memberId=' + this.phone;
				console.log('最后拼接出出来的this.url: '+this.url);
				// this.url = ''http://120.79.0.124/h5/#/''
				// this.url = 'http://119.91.155.46/sc/#/?accessToken='+this.idToken;
				// this.url = 'http://localhost:8081/#/?accessToken='+this.idToken;
			},
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}

	.Combination {
		margin-top: 224rpx;
		display: flex;
		justify-content: center;
		/* border: 1rpx solid; */
	}

	image {
		width: 550rpx;
		height: 550rpx;
	}
</style>
